/*
 * @author Zhangchengwei
 * 2013-01-28
 * */

/*
 * 当鼠标移动到查询文章模块上的DIV时改变其样式
 * */
function mouseOver(Obj){
	Obj.className = "part-articleList-item-mouserover";
}

/*
 * 当鼠标离开查询文章模块上的DIV时改变其样式
 * */
function mouseOut(Obj){
	Obj.className = "part-articleList-item";
}

/*---------------------底端菜单执行方法---------------------------*/
function getMouseX(){
	var theEvent = window.event || arguments.callee.caller.arguments[0];
	var evenX = theEvent.clientX;
	return evenX;
}
function getMouseY(){
	var theEvent = window.event || arguments.callee.caller.arguments[0];
	var evenY = theEvent.clientY;
	return evenY;
}
function buttomMenuItemsLeftPx(node){
	for(var x=-document.documentElement.scrollLeft; node != null; node = node.offsetParent) x+=node.offsetLeft;
	return x;
}
	
//获得指定Item的相对坐标 
function nodePositionX(node){
	var x = node.offsetLeft + node.offsetParent.offsetLeft;
	return x;
}

//获得地图div的X,Y坐标
function getMapPosition(){
	return $("#map_container").position();
}

function setIndexCenterBottomMenuPosion(){
	var positionY = getMapPosition().top + 55;
	var positionX = getMapPosition().left + (parseInt($("#map_container").width()) - parseInt($("#menu-Items").width()));
	$("#index-center-bottom-menu").css({'left':positionX, 'top': positionY, 'display': 'block'});
}

/*设置显示更多标签的div坐标和标签框div的坐标*/
function setTagPromptPosition(){
	
	var addArticleNode = $("#addArticle");
	var classifyShowNode = $("#classifyShow");
	
	var offset = {
			"classifyShowLeft": -(classifyShowNode.width()),
			"positionTop": -($(".menu-Items-ItemImg").height()),
			"addArticlePositionLeft": -(addArticleNode.width())
	};
	
	addArticleNode.css({'left': offset.addArticlePositionLeft - 10, 'top': offset.positionTop});
	classifyShowNode.css({'left': offset.classifyShowLeft - 10, 'top': 0});
}

/*设置显示当前位置的div的样式*/
function setShowAddrPosition(){
	$("#map_pos_info").css({'left':(getMapPosition().left + 127), 'top': (getMapPosition().top + 5), 'display': 'block'});
}

function bottomMenuItemMouseOver(obj){
	/*$(obj).animate({'-moz-opacity':'1', 'opacity':'1', 'filter':'alpha(opacity=100)','width': 98, 'height': 98}, "normal");*/
	/*$(obj).css("border", "2px solid red");*/
	$(obj).animate({'-moz-opacity':'1', 'opacity':'1', 'filter':'alpha(opacity=100)'}, 300);
}

function bottomMenuItemMouseOut(obj){
	/*$(obj).css("border", "none");*/
	$(obj).animate({'-moz-opacity':'0.5', 'opacity':'0.5', 'filter':'alpha(opacity=50)'}, 300);
}
